package com.rxjava.simple;

/**
 * Created by iceGeneral on 2016/10/15.
 */
public class Test {
    public static void main(String[] args) {

    	//这里可以看出 subscribe(subscriber)-->onSubscribe.call(subscriber)，所以没有订阅动作就不会触发 OnSubscribe.call()
        Observable
                .create(new OnSubscribe<Integer>() {
                    @Override
                    public void call(Subscriber<? super Integer> subscriber) {
                        subscriber.onNext(1);
                    }
                })
                .subscribe(new Subscriber<Integer>() {
                    @Override
                    public void onNext(Integer integer) {
                        System.out.println(integer);
                    }
                });
        System.out.println("-------------------------------------------------------------");
    }

}
